Skip to content

feat(blocks): add block merging via Backspace/Delete and TodoList story#148

Merged
Nowely merged 3 commits intonextfrom
update-block
Mar 11, 2026
Merged

feat(blocks): add block merging via Backspace/Delete and TodoList story#148
Nowely merged 3 commits intonextfrom
update-block

Conversation

@Nowely
Copy link
Owner

@Nowely Nowely commented Mar 11, 2026

Summary

  • Add mergeBlocks and getMergeJoinPos utilities in core block operations for joining adjacent blocks
  • Backspace at position 0 of a non-first block merges it into the previous block
  • Delete at end of a non-last block merges it forward with the next block
  • Add TodoList story demonstrating Notion-like checklist functionality built on the block editor

Nowely added 3 commits March 10, 2026 11:09
- Implemented merging of blocks when Delete is pressed at the start of a non-first block, similar to Backspace behavior.
- Updated tests to cover new merging scenarios, including preserving content and maintaining focus after merges.
- Added checks to prevent merging when Delete is pressed at the end of the last block or at the start of the first block.

This improves the user experience by allowing more intuitive block management in the editor.
…ced block merging

- Introduced `mergeBlocks` to merge adjacent blocks by removing separators, handling cases where separators are embedded in mark tokens.
- Added `getMergeJoinPos` to determine the correct join position for merging blocks, improving caret positioning.
- Expanded unit tests to cover new merging scenarios, including edge cases with embedded separators.
- Updated `KeyDownController` to utilize the new functions for better block management during keyboard interactions.

This enhances the block editing experience by ensuring seamless merging and caret management in the editor.
…tionality

- Introduced a new `TodoList` story showcasing a Notion-like checklist with nested hierarchy.
- Created `TodoMark` component to render checklist items with visual indicators for pending and completed tasks.
- Defined `todoOptions` for customizable rendering of checklist items based on their status.
- Added a sample checklist value to demonstrate the component's functionality in the story.

This enhances the storybook by providing a practical example of a checklist feature, improving the overall user experience.
@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markput-react Ready Ready Preview, Comment Mar 11, 2026 11:20am
markput-vue Ready Ready Preview, Comment Mar 11, 2026 11:20am
markput-website Ready Ready Preview, Comment Mar 11, 2026 11:20am

@Nowely Nowely merged commit 0685033 into next Mar 11, 2026
10 checks passed
@Nowely Nowely deleted the update-block branch March 11, 2026 11:20
Nowely pushed a commit that referenced this pull request Mar 15, 2026
🤖 I have created a release *beep* *boop*
---


## [0.6.0](0.5.0...0.6.0)
(2026-03-15)


### Features

* **blocks:** add block merging via Backspace/Delete and TodoList story
([#148](#148))
([0685033](0685033))
* **blocks:** Notion-like block editor with keyboard navigation, block
operations, and drag-and-drop
([#146](#146))
([4bd5534](4bd5534))
* **drag:** replace block mode with drag-and-drop row management
([#149](#149))
([83034e8](83034e8))
* **storybook:** add withPlainValue decorator and enhance drag/text
stories ([#151](#151))
([1d76c1f](1d76c1f))


### Refactoring

* **storybook:** standardize stories with PlainValuePanel and StoryObj
types across React and Vue
([#152](#152))
([42d21f3](42d21f3))


### Miscellaneous

* upgrade to Vite 8, Vitest 4.1, and Astro 6
([#150](#150))
([693966d](693966d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant